package cn.fl.ass.service;

import java.util.Date;
import java.util.List;

import cn.fl.ass.vo.AssTrailCarMVO;
import cn.fl.ass.vo.ProductStatusLogVO;
import cn.fl.project.vo.PrjPaySchMYqVO;
import cn.fl.system.condition.SysBkAccInfoQueryCondition;
import cn.fl.system.condition.SysBkInfoQueryCondition;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import com.alibaba.fastjson.JSONObject;
import fl.ass.facade.condition.AssDealCarQueryCondition;
import fl.ass.facade.condition.AssTrailCarDQueryCondition;
import fl.ass.facade.condition.AssTrailCarHvQueryCondition;
import fl.flow.facade.flow.condition.SysFlowSHQueryCondition;
import fl.flow.facade.flow.dto.SysFlowSHDTO;

/**
 * @Description: 拖车信息主表 客户端服务层接口
 * @Description: 持久层方法名称前缀：新增：insert* 删除：delete* 修改：update* 批量：batch* 查询对象：select* get* find* 查询集合：select*
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
public interface IAssTrailCarMService {
	
	/**
	 * 获取唯一对象
	 * @param id 主键
	 * @return 对象DTO
	 */
	public AssTrailCarMVO selectById(Long id)throws BaseException;
	
	/**
	 * 新增
	 * @param entity
	 * @return
	 */
    public Long add(AssTrailCarMVO entity) throws BaseException;

    /**
     * 删除
     * @param id
     * @return
     */
    public boolean removeById(Long id)throws BaseException;
    
    /**
     * 删除
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids)throws BaseException;

    /**
     * 修改
     * @param entity
     * @return
     */
    public boolean modify(AssTrailCarMVO entity)throws BaseException;

    /**
     * 分页查询所有
     * @param page
     * @return
     */
    public Pager searchListPage(Pager page)throws BaseException;
    
    /**
     * 拖车模块-发起流程
     * @param qc
     * @return
     * @throws BaseException
     */
    public DataResultVO addTrailCarApply(AssTrailCarDQueryCondition qc) throws BaseException;
    
    /**
	 * 根据字段代码组获取代码值集合
	 * @param grpCd 代码组值
	 * @param sysCd 系统代码
	 * @param orgCd 组织结构代码
	 * @return 值
	 * @throws BaseException
	 */
	public List<KeyValueVO> getKvList(String grpCd, String sysCd, String orgCd) throws BaseException;
    
	/**
     * 分页查询所有拖车相关流程
     * @param qc
     * @return
     */
    public List<SysFlowSHDTO> searchFlowListPage(SysFlowSHQueryCondition qc)throws BaseException;
    
    /**
	 * 导出拖车模块信息
	 * @param condition
	 * @param orgCd
	 * @return
	 * @throws BaseException
	 */
	public String exportAssInfo(AssTrailCarDQueryCondition qc1, AssDealCarQueryCondition qc2, AssTrailCarHvQueryCondition qc3,String orgCd, String eFlag)throws BaseException;
	
	/**
	 * 获取付款银行信息
	 * @param qc
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> searchBankNmKVList(SysBkInfoQueryCondition qc, String sysCd, String orgCd)throws BaseException;
	
	/**
	 * 获取付款银行-账号信息
	 * @param qc
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> searchAccNoKVList(SysBkAccInfoQueryCondition qc, String sysCd, String orgCd)throws BaseException;

    /**
     * 获取yq信息
     * @param prjPrdDtlId
     * @return
     * @throws BaseException
     */
	List<PrjPaySchMYqVO> searchYQPayInfo(Long prjPrdDtlId, Date applyDt) throws BaseException;

    /**
     * 查疫情贷的逾期租金和未来本金合计
     * @param paySchId
     * @return
     * @throws BaseException
     */
    JSONObject searchYQOvdAndFutureAmt(Long paySchId) throws BaseException;

    /**
     * 根据流程流转更新疫情支付表状态
     * @throws BaseException
     */
    void updateYQPrdStsCdByFlow(ProductStatusLogVO productStatusLogVO) throws BaseException;

    /**
     * 根据项目产品明细id校验是否可发起处置或转优车流程（未放款 或 已放款+非正常就不允许发起）
     * @param assMainId
     * @return
     * @throws BaseException
     */
    boolean checkDealOrTransUsedFlowStart(Long assMainId) throws BaseException;

    /**
     * 对2021.2.22 18:38:00之前的流程历史进行判断（若为之前则跳过校验）
     * @param dataId
     * @return
     * @throws BaseException
     */
    String isNeedValid(Long dataId) throws BaseException;

}
